package com.seago.iceberg.api;

import com.seago.iceberg.model.CadDocument;
import com.seago.iceberg.repository.CadDocumentRepository;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Title:
 * <p>
 * description:
 *
 * @Company: 中国船舶集团海舟系统技术有限公司-武汉
 * @author: yangs
 * @since: 2023-05-08 10:00
 * @version: 1.0
 **/
@RestController
@RequestMapping("/cadDocument")
public class CadDocumentApi {

	@Resource
	private CadDocumentRepository cadDocumentRepository;


	@PostMapping(value = "/save")
	void save(@RequestBody CadDocument cadDocument) throws Exception {
		cadDocumentRepository.save(cadDocument);
	}

	@GetMapping("/findAll")
	List<CadDocument> findAll() {
		return cadDocumentRepository.findAll();
	}

	@GetMapping("/getById/{id}")
	List<CadDocument> getById(@PathVariable("id") String id) {
		return cadDocumentRepository.getById(id);
	}


}
